﻿@model IEnumerable<CloudFranceTriple.Models.PrivateMessageBoxSet>

<tr>
    <td colspan="5">
        <h2>@CloudFranceTriple.WebRole.Properties.Resources.PrivateMessageSentTitle (@Model.Count())</h2>
    </td>
</tr>
<tr>
    <th>
        @CloudFranceTriple.WebRole.Properties.Resources.PrivateMessageSubject
    </th>
    <th>
        @CloudFranceTriple.WebRole.Properties.Resources.PrivateMessageTo
    </th>
    <th>
        @CloudFranceTriple.WebRole.Properties.Resources.PrivateMessageCreationDate
    </th>
    <th></th>
</tr>
@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.MessageBody_Label)
        </td>
        <td>
           @(new CloudFranceTriple.WebRole.Models.UsersContext().UserProfiles.Find(item.ToPrivateMessage).UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.MessageBody_CreationDate,"TemplateUserDateTime")
        </td>
        <td>
            @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonRead, "Details", "PrivateMessage", new { id = item.Id, area = "Forum" }, null)
        </td>
    </tr>
}